﻿Imports System
Imports System.Collections
Imports System.Collections.Specialized
Imports System.Drawing

Namespace System.Workflow.ComponentModel.Design
    Friend Class ItemInfo
        ' Methods
        Public Sub New(ByVal id As Integer)
            Me.commandID = id
        End Sub

        Public Sub New(ByVal id As Integer, ByVal image As Image, ByVal [text] As String)
            Me.New(id)
            Me.image = image
            Me.text = [text]
        End Sub

        Public Overrides Function Equals(ByVal obj As Object) As Boolean
            Return (((Not obj Is Nothing) AndAlso TypeOf obj Is ItemInfo) AndAlso (DirectCast(obj, ItemInfo).commandID = Me.commandID))
        End Function

        Public Overrides Function GetHashCode() As Integer
            Return (MyBase.GetHashCode Xor Me.commandID.GetHashCode)
        End Function


        ' Properties
        Public ReadOnly Property Identifier As Integer
            Get
                Return Me.commandID
            End Get
        End Property

        Public ReadOnly Property Image As Image
            Get
                Return Me.image
            End Get
        End Property

        Public ReadOnly Property [Text] As String
            Get
                Return Me.text
            End Get
        End Property

        Public ReadOnly Property UserData As IDictionary
            Get
                If (Me.userData Is Nothing) Then
                    Me.userData = New HybridDictionary
                End If
                Return Me.userData
            End Get
        End Property


        ' Fields
        Private commandID As Integer
        Private image As Image
        Private [text] As String
        Private userData As IDictionary
    End Class
End Namespace

